local fushen = fk.CreateSkill {
  name = "th_fushen",
}

fushen:addEffect(fk.AskForRetrial, {
  anim_type = "control",
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(fushen.name) and data.card and target and not target:isKongcheng()
  end,
  on_cost = function(self, event, target, player, data)
    return player.room:askToSkillInvoke(player, {
      skill_name = fushen.name,
      prompt = "#th_fushen-invoke:" .. target.id .. "::" .. data.reason
    })
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local id = room:askToChooseCard(player, {
      target = target,
      flag = "h",
      skill_name = fushen.name
    })
    target:showCards({id})
    local card = Fk:getCardById(id)
    room:changeJudge{
      card = card,
      player = target,
      data = data,
      skillName = fushen.name,
      exchange = false
    }
  end,
})

Fk:loadTranslationTable{
  ["th_fushen"] = "复审",
  [":th_fushen"] = "一名角色的判定牌生效前，你可以展示其一张手牌，其用此牌代替之。",

  ["#th_fushen-invoke"] = "复审：你可以展示 %src 一张手牌，其用此牌代替 %arg 的判定",
}

return fushen